import { axios } from '@/utils/request'

const api = {
  reservation: '/meeting/reservation'
}

export function getReservationList (parameter) {
  return axios({
    url: api.reservation + '/list',
    method: 'get',
    params: parameter
  })
}

export function personList (parameter) {
  return axios({
    url: '/person/list',
    method: 'get',
    params: parameter
  })
}

export function get (id) {
  return axios({
    url: api.reservation + '/get/'+id,
    method: 'get',
    params: {}
  })
}

export function roomContentList (params) {
  return axios({
    url: '/meeting/roomContent/roomContentList',
    method: 'get',
    params: params
  })
}


export function saveReservation (parameter) {
  return axios({
    url: api.reservation + (parameter.id > 0 ? '/update' : '/save'),
    method: 'post',
    data: parameter,
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    }
  })
}

export function delReservation (parameter) {
  return axios({
    url: api.reservation + '/remove',
    method: 'post',
    params: parameter
  })
}

export const reservationExport = api.reservation + '/export'
